USE [dotUmlTest]
GO

/****** Object:  Table [dbo].[DiagramEngineTest_ValidateTest]    Script Date: 04/09/2010 14:58:14 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

/*
 Create the DiagramEngineTest_ValidateTest table and 
 insert test data into it.
*/

DROP TABLE [dbo].[DiagramEngineTest_ValidateTest]

CREATE TABLE [dbo].[DiagramEngineTest_ValidateTest](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[dotUMLDocument] [varchar](max) NOT NULL,
	[ExpectedResult] bit NOT NULL,
	[TestDescription] [nvarchar](255) NOT NULL
) ON [PRIMARY]

INSERT INTO [dotUmlTest].[dbo].[DiagramEngineTest_ValidateTest]
           ([dotUMLDocument], [ExpectedResult], [TestDescription])
     VALUES
           ('<?xml version="1.0" encoding="UTF-8"?>
			<model
				<stereotypes>
					<stereotype name="stereotype1" />
					<stereotype name="stereotype2" />
				</stereotypes>	
				<diagrams>	
					<sequenceDiagram name="diagram1" >	
					</sequenceDiagram>	
				</diagrams>
			</model>',
			0,
			'Test xml validation of an incorrect xml layout.')

INSERT INTO [dotUmlTest].[dbo].[DiagramEngineTest_ValidateTest]
           ([dotUMLDocument], [ExpectedResult], [TestDescription])
     VALUES
           ('<?xml version="1.0" encoding="UTF-8"?>
			<model>
				<stereotypes>
					<stereotype name="stereotype1" />
					<stereotype name="stereotype2" />
				</stereotypes>	
				<diagrams>	
					<sequenceDiagram name="diagram1" >	
					</sequenceDiagram>	
				</diagrams>
			</model>',
			0,
			'Test xml validation of an empty <diagrams> node.')

INSERT INTO [dotUmlTest].[dbo].[DiagramEngineTest_ValidateTest]
           ([dotUMLDocument], [ExpectedResult], [TestDescription])
     VALUES
           ('<?xml version="1.0" encoding="UTF-8"?>
			<model>
				<stereotypes>
					<stereotype name="stereotype1" />
					<stereotype name="stereotype2" />
				</stereotypes>	
			  <diagrams>	
				  <sequenceDiagram name="diagram1" >	
				  <lifelines>
					<lifeline name="lifeline1" data_type="type1" type="actor" stereotypes="stereotype1,stereotype2" />
					<lifeline name="lifeline2" data_type="type2" type="normal" stereotypes="stereotype1,stereotype2" />
					<lifeline name="lifeline3" data_type="type3" type="normal" stereotypes="stereotype1,stereotype2" />
				  </lifelines>
				  <messages>	
						  <message name="message1" type="call" source="lifeline1" target="lifeline2" async="true" label="Method1(a,b)" stereotypes="stereotype1,stereotype2" />	
						  <message name="message2" type="call" source="lifeline2" target="lifeline3" async="false" label="Method2(a,b)" stereotypes="stereotype1,stereotype2" />	
						  <message name="message3" type="call" source="lifeline1" target="reference1" async="false" label="Method3(a,b)" stereotypes="stereotype1" />	
					  </messages>
				  <constraints>
					<constraint name="constraint1" type="duration" value="1..12">
					  <ref name="message1" />
					</constraint>
				  </constraints>
				  <combined_fragments>
					<combined_fragment name="combined_fragment1" type="loop">
					  <ref name="message1" />
					</combined_fragment>
					<combined_fragment_alt name="combined_fragment2" type="alt">
					  <main>
						<ref name="message1" />
					  </main>
					  <alt>
						<ref name="message2" />
					  </alt>
					</combined_fragment_alt>
				  </combined_fragments>	
					  <invariants>	
						  <invariant name="invariant1" value="p==15" lifeline="lifeline1" />	
					  </invariants>
				  <destructions>
					<destruction name="destruction1" message="message3" />
				  </destructions>
					  <continuations>	
						  <continuation name="continuation1" value="OK">	
							  <ref name="lifeline1" />	
							  <ref name="lifeline2" />	
						  </continuation>	
					  </continuations>	
					  <concurrents>	
						  <concurrent name="concurrent1" lifeline="lifeline1">	
							  <ref name="message3" />	
						  </concurrent>	
					  </concurrents>	
					  <references>		
						<reference name="reference1">	
								<ref name="lifeline2" />	
								<ref name="lifeline3" />		
						</reference>	
					  </references>	
					  <sequence>	
						  <ref name="continuation1"/>	
						  <ref name="message1"/>	
						  <ref name="message2"/>	
						  <ref name="message3"/>
					<ref name="destruction1"/>
						  <ref name="invariant1"/>	
					  </sequence>	
				  </sequenceDiagram>	
			  </diagrams>
			</model>',
			1,
			'Test xml validation of a correct xml-file.')

/*
 Create the DiagramEngineTest_ProcessTest table and 
 insert test data into it.
*/

DROP TABLE [dbo].[DiagramEngineTest_ProcessTest]

CREATE TABLE [dbo].[DiagramEngineTest_ProcessTest](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[dotUMLDocument] [varchar](max) NOT NULL,
	[ExpectedResult] bit NOT NULL,
	[TestDescription] [nvarchar](255) NOT NULL
) ON [PRIMARY]

INSERT INTO [dotUmlTest].[dbo].[DiagramEngineTest_ProcessTest]
           ([dotUMLDocument], [ExpectedResult], [TestDescription])
     VALUES
           ('<?xml version="1.0" encoding="UTF-8"?>
			<model>
				<stereotypes>
					<stereotype name="stereotype1" />
					<stereotype name="stereotype2" />
				</stereotypes>	
			  <diagrams>	
				  <sequenceDiagram name="diagram1" >	
				  <lifelines>
					<lifeline name="lifeline1" data_type="type1" type="actor" stereotypes="stereotype1,stereotype2" />
					<lifeline name="lifeline2" data_type="type2" type="normal" stereotypes="stereotype1,stereotype2" />
					<lifeline name="lifeline3" data_type="type3" type="normal" stereotypes="stereotype1,stereotype2" />
				  </lifelines>
				  <messages>	
						  <message name="message1" type="call" source="lifeline1" target="lifeline2" async="true" label="Method1(a,b)" stereotypes="stereotype1,stereotype2" />	
						  <message name="message2" type="call" source="lifeline2" target="lifeline3" async="false" label="Method2(a,b)" stereotypes="stereotype1,stereotype2" />	
						  <message name="message3" type="call" source="lifeline1" target="reference1" async="false" label="Method3(a,b)" stereotypes="stereotype1" />	
					  </messages>
				  <constraints>
					<constraint name="constraint1" type="duration" value="1..12">
					  <ref name="message1" />
					</constraint>
				  </constraints>
				  <combined_fragments>
					<combined_fragment name="combined_fragment1" type="loop">
					  <ref name="message1" />
					</combined_fragment>
					<combined_fragment_alt name="combined_fragment2" type="alt">
					  <main>
						<ref name="message1" />
					  </main>
					  <alt>
						<ref name="message2" />
					  </alt>
					</combined_fragment_alt>
				  </combined_fragments>	
					  <invariants>	
						  <invariant name="invariant1" value="p==15" lifeline="lifeline1" />	
					  </invariants>
				  <destructions>
					<destruction name="destruction1" message="message3" />
				  </destructions>
					  <continuations>	
						  <continuation name="continuation1" value="OK">	
							  <ref name="lifeline1" />	
							  <ref name="lifeline2" />	
						  </continuation>	
					  </continuations>	
					  <concurrents>	
						  <concurrent name="concurrent1" lifeline="lifeline1">	
							  <ref name="message3" />	
						  </concurrent>	
					  </concurrents>	
					  <references>		
						<reference name="reference1">	
								<ref name="lifeline2" />	
								<ref name="lifeline3" />		
						</reference>	
					  </references>	
					  <sequence>	
						  <ref name="continuation1"/>	
						  <ref name="message1"/>	
						  <ref name="message2"/>	
						  <ref name="message3"/>
					<ref name="destruction1"/>
						  <ref name="invariant1"/>	
					  </sequence>	
				  </sequenceDiagram>	
			  </diagrams>
			</model>',
			1,
			'Test xml processing of a correct xml-file.')

/*
 Create the StereotypesXmlParserTest_ParseTest table and 
 insert test data into it.
*/

DROP TABLE [dbo].[StereotypesXmlParserTest_ParseTest]

CREATE TABLE [dbo].[StereotypesXmlParserTest_ParseTest](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[xmlFragment] [varchar](max) NOT NULL,
	[ExpectedResult] bit NOT NULL,
	[TestDescription] [nvarchar](255) NOT NULL
) ON [PRIMARY]

INSERT INTO [dotUmlTest].[dbo].[StereotypesXmlParserTest_ParseTest]
           ([xmlFragment], [ExpectedResult], [TestDescription])
     VALUES
           ('<stereotypes>
					<stereotype name="stereotype1" />
					<stereotype name="stereotype2" />
			</stereotypes>',
			1,
			'Test parsing of a correct stereotypes fragment.')

INSERT INTO [dotUmlTest].[dbo].[StereotypesXmlParserTest_ParseTest]
           ([xmlFragment], [ExpectedResult], [TestDescription])
     VALUES
           ('<stereotypes>
					<stereotype name="stereotype1" />
					<stereotype name="stereotype1" />
			</stereotypes>',
			0,
			'Test parsing of a stereotypes fragment with a doubled stereotype.')

INSERT INTO [dotUmlTest].[dbo].[StereotypesXmlParserTest_ParseTest]
           ([xmlFragment], [ExpectedResult], [TestDescription])
     VALUES
           ('<stereotypes>
			</stereotypes>',
			1,
			'Test parsing of an empty stereotypes fragment.')

/*
 Create the SequenceDiagramXmlParserTest_ParseTest table and 
 insert test data into it.
*/

DROP TABLE [dbo].[SequenceDiagramXmlParserTest_ParseTest]

CREATE TABLE [dbo].[SequenceDiagramXmlParserTest_ParseTest](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[diagramName] [varchar](max) NOT NULL,
	[xmlFragment] [varchar](max) NOT NULL,
	[ExpectedResult] bit NOT NULL,
	[TestDescription] [nvarchar](255) NOT NULL
) ON [PRIMARY]

INSERT INTO [dotUmlTest].[dbo].[SequenceDiagramXmlParserTest_ParseTest]
           ([diagramName], [xmlFragment], [ExpectedResult], [TestDescription])
     VALUES
           ('diagram1',
           '<sequenceDiagram name="diagram1" >	
				  <lifelines>
					<lifeline name="lifeline1" data_type="type1" type="actor" stereotypes="stereotype1,stereotype2" />
					<lifeline name="lifeline2" data_type="type2" type="normal" stereotypes="stereotype1,stereotype2" />
					<lifeline name="lifeline3" data_type="type3" type="normal" stereotypes="stereotype1,stereotype2" />
				  </lifelines>
				  <messages>	
						  <message name="message1" type="call" source="lifeline1" target="lifeline2" async="true" label="Method1(a,b)" stereotypes="stereotype1,stereotype2" />	
						  <message name="message2" type="call" source="lifeline2" target="lifeline3" async="false" label="Method2(a,b)" stereotypes="stereotype1,stereotype2" />	
						  <message name="message3" type="call" source="lifeline1" target="reference1" async="false" label="Method3(a,b)" stereotypes="stereotype1" />	
					  </messages>
				  <constraints>
					<constraint name="constraint1" type="duration" value="1..12">
					  <ref name="message1" />
					</constraint>
				  </constraints>
				  <combined_fragments>
					<combined_fragment name="combined_fragment1" type="loop">
					  <ref name="message1" />
					</combined_fragment>
					<combined_fragment_alt name="combined_fragment2" type="alt">
					  <main>
						<ref name="message1" />
					  </main>
					  <alt>
						<ref name="message2" />
					  </alt>
					</combined_fragment_alt>
				  </combined_fragments>	
					  <invariants>	
						  <invariant name="invariant1" value="p==15" lifeline="lifeline1" />	
					  </invariants>
				  <destructions>
					<destruction name="destruction1" message="message3" />
				  </destructions>
					  <continuations>	
						  <continuation name="continuation1" value="OK">	
							  <ref name="lifeline1" />	
							  <ref name="lifeline2" />	
						  </continuation>	
					  </continuations>	
					  <concurrents>	
						  <concurrent name="concurrent1" lifeline="lifeline1">	
							  <ref name="message3" />	
						  </concurrent>	
					  </concurrents>	
					  <references>		
						<reference name="reference1">	
								<ref name="lifeline2" />	
								<ref name="lifeline3" />		
						</reference>	
					  </references>	
					  <sequence>	
						  <ref name="continuation1"/>	
						  <ref name="message1"/>	
						  <ref name="message2"/>	
						  <ref name="message3"/>
					<ref name="destruction1"/>
						  <ref name="invariant1"/>	
					  </sequence>	
				  </sequenceDiagram>',
			1,
			'Test parsing of a proper sequence diagram fragment.')
			
INSERT INTO [dotUmlTest].[dbo].[SequenceDiagramXmlParserTest_ParseTest]
           ([diagramName], [xmlFragment], [ExpectedResult], [TestDescription])
     VALUES
           ('diagram2',
           '<sequenceDiagram name="diagram2" >
				<class />
			</sequenceDiagram>',
			0,
			'Test parsing of a sequence diagram with a wrong element.')

INSERT INTO [dotUmlTest].[dbo].[SequenceDiagramXmlParserTest_ParseTest]
           ([diagramName], [xmlFragment], [ExpectedResult], [TestDescription])
     VALUES
           ('diagram3',
           '<sequenceDiagram name="diagram3" >
			  <lifelines>
				<lifeline data_type="type1" type="actor" stereotypes="stereotype1,stereotype2" />
			  </lifelines>
			</sequenceDiagram>',
			0,
			'Test parsing of a sequence diagram with a lifeline which does not have a name.')

INSERT INTO [dotUmlTest].[dbo].[SequenceDiagramXmlParserTest_ParseTest]
           ([diagramName], [xmlFragment], [ExpectedResult], [TestDescription])
     VALUES
           ('diagram4',
           '<sequenceDiagram name="diagram4" >
			  <lifelines>
				<lifeline name="lifeline1" data_type="type1" stereotypes="stereotype1,stereotype2" />
			  </lifelines>
			</sequenceDiagram>',
			0,
			'Test parsing of a sequence diagram with a lifeline which does not have a type.')

INSERT INTO [dotUmlTest].[dbo].[SequenceDiagramXmlParserTest_ParseTest]
           ([diagramName], [xmlFragment], [ExpectedResult], [TestDescription])
     VALUES
           ('diagram5',
           '<sequenceDiagram name="diagram5" >
			  <lifelines>
				<lifeline name="lifeline1" data_type="type1" type="actor" stereotypes="stereotype1,stereotype2" />
				<lifeline name="lifeline1" type="normal" stereotypes="stereotype1,stereotype2" />
			  </lifelines>
			</sequenceDiagram>',
			0,
			'Test parsing of a sequence diagram with two lifelines having the same name.')

INSERT INTO [dotUmlTest].[dbo].[SequenceDiagramXmlParserTest_ParseTest]
           ([diagramName], [xmlFragment], [ExpectedResult], [TestDescription])
     VALUES
           ('diagram6',
           '<sequenceDiagram name="diagram6" >
			  <lifelines>
				<lifeline name="lifeline1" data_type="type1" type="actor" stereotypes="stereotype1,stereotype2,stereotype3" />
			  </lifelines>
			</sequenceDiagram>',
			0,
			'Test parsing of a sequence diagram with a lifeline having an unknown stereotype.')






GO

SET ANSI_PADDING OFF
GO


